#Read data
incl<-read.csv("Inc_Nets.csv")

#Remove testing data and unfinished responses and those who chose not to offer gender or race
incl_fin<-subset(incl,incl$Status=="IP Address"&incl$Finished=="True"&Q18!="Prefer not to answer"&Q19.1!="Prefer not to answer")

#Convert answers into usable form
incl_fin$Q18<-factor(incl_fin$Q18)
incl_fin$Q19.1<-factor(incl_fin$Q19.1)
incl_fin$Q5<-factor(incl_fin$Q5)
incl_fin$Q6<-factor(incl_fin$Q6)
incl_fin$Q7<-factor(incl_fin$Q7)
incl_fin$Q8<-factor(incl_fin$Q8)
incl_fin$Q9<-factor(incl_fin$Q9)
incl_fin$Q10<-factor(incl_fin$Q10)
incl_fin$Q11<-factor(incl_fin$Q11)
incl_fin$Q12<-factor(incl_fin$Q12)
incl_fin$Q13<-factor(incl_fin$Q13)
incl_fin$Q14<-factor(incl_fin$Q14)
incl_fin$Q20<-factor(incl_fin$Q20)
incl_fin$Q1<-factor(incl_fin$Q1)
incl_fin$Q21.1<-factor(incl_fin$Q21.1)

#reorder factors of some questions
incl_fin$Q5<-factor(incl_fin$Q5,levels(incl_fin$Q5)[c(1,5,2,3,4)])
incl_fin$Q6<-factor(incl_fin$Q6,levels(incl_fin$Q6)[c(1,4,2,3,5)])
incl_fin$Q7<-factor(incl_fin$Q7,levels(incl_fin$Q7)[c(1,4,2,3,5)])
incl_fin$Q8<-factor(incl_fin$Q8, levels(incl_fin$Q8)[c(1,4,5,6,2,3)])
incl_fin$Q9<-factor(incl_fin$Q9, levels(incl_fin$Q9)[c(1,4,5,6,2,3)])
#incl_fin$Q10<-factor(incl_fin$Q10) No obvious ordering
incl_fin$Q11<-factor(incl_fin$Q11, levels(incl_fin$Q11)[c(2,1,3)])
incl_fin$Q13<-factor(incl_fin$Q13, levels(incl_fin$Q13)[c(1,4,5,6,2,3)])
incl_fin$Q14<-factor(incl_fin$Q14, levels(incl_fin$Q14)[c(1,3,4,5,2)])
incl_fin$Q20<-factor(incl_fin$Q20, levels(incl_fin$Q20)[c(2,3,1)])
#incl_fin$Q1<-factor(incl_fin$Q1) No obvious ordering and also more than one choice allowed

#Create Intersectionality Variable
incl_fin$inter<-factor(ifelse(incl_fin$Q18=="Yes", ifelse(incl_fin$Q19.1=="Yes","Both","Gender Only"), ifelse(incl_fin$Q19.1=="Yes","Racial Only","Neither")))
incl_fin$inter<-factor(incl_fin$inter, levels(incl_fin$inter)[c(3,2,4,1)])

#Create Intersectionality Variable including occupation
incl_fin$inter2<-factor(ifelse(incl_fin$inter=="Neither", 
                               ifelse(incl_fin$Q20=="Faculty Member","Faculty Neither","Grad/Postdoc Neither"),
                               ifelse(incl_fin$inter=="Gender Only", 
                                      ifelse(incl_fin$Q20=="Faculty Member","Faculty Gender Only","Grad/Postdoc Gender Only"),
                                      ifelse(incl_fin$inter=="Racial Only", 
                                             ifelse(incl_fin$Q20=="Faculty Member","Faculty Racial Only","Grad/Postdoc Racial Only"),
                                             ifelse(incl_fin$Q20=="Faculty Member","Faculty Both","Grad/Postdoc Both")))))
incl_fin$inter2<-factor(incl_fin$inter2, levels(incl_fin$inter2)[c(3,7,2,6,4,8,1,5)])

library(forcats)

#Plot from Paper
attend6<-table(fct_collapse(subset(incl_fin$Q5,incl_fin$Q20=="Faculty Member"),Low=c("None","A few"), High=c("About half","Almost all")), subset(incl_fin$Q18,incl_fin$Q20=="Faculty Member"), exclude = "")
chisq.test(attend6)
barplot(attend6, ylab="Underrepresented Gender Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,30))

#Other exploratory comparisons, including those in appendix

#sample statistics
samp<-table(incl_fin$Q20,incl_fin$Q18)
barplot(samp, ylab="Underrepresented Gender Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,50), main="Occupation")

#sample statistics_race
samp_race<-table(incl_fin$Q20,incl_fin$Q19.1)
barplot(samp_race, ylab="Underrepresented Racial Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,80), main="Occupation")

#sample statistics_intersection
samp_inter<-table(incl_fin$Q20,incl_fin$inter)
barplot(samp_inter, ylab="Underrepresented Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,50), main="Occupation")


#Create tables by gender and race

#where prof opportunities?--gender
setting<-table(incl_fin$Q10, incl_fin$Q18, exclude = "")
chisq.test(setting)
barplot(setting, ylab="Underrepresented Gender Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,50), main="In which one of the following settings do you feel that you become \n aware of professional opportunities and contacts best?", args.legend = c(cex=.6))

#combine formal categories and informal ones
setting2<-table(fct_collapse(incl_fin$Q10, Formal=c("In formal settings, among colleagues whom I may not know well: e.g., while meeting visiting speakers.","In formal settings, among colleagues whom I know well: e.g., in meetings with advisors or committees."), Informal=c("In informal settings, among colleagues whom I know well: e.g., informal social events with colleagues and friends.","In informal settings, among colleagues whom I may not know well: e.g., networking events at conferences.")), incl_fin$Q18, exclude = "")
chisq.test(setting2)
barplot(setting2, ylab="Underrepresented Gender Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,50), main="In which one of the following settings do you feel that you become \n aware of professional opportunities and contacts best?", args.legend = c(cex=.6))

#where prof opportunities?--race
setting_race<-table(incl_fin$Q10, incl_fin$Q19.1, exclude = "")
chisq.test(setting_race)
barplot(setting_race, ylab="Underrepresented Racial Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,80), main="In which one of the following settings do you feel that you become \n aware of professional opportunities and contacts best?", args.legend = c(cex=.6))

#where prof opportunities?--race combined
setting_race2<-table(fct_collapse(incl_fin$Q10, Formal=c("In formal settings, among colleagues whom I may not know well: e.g., while meeting visiting speakers.","In formal settings, among colleagues whom I know well: e.g., in meetings with advisors or committees."), Informal=c("In informal settings, among colleagues whom I know well: e.g., informal social events with colleagues and friends.","In informal settings, among colleagues whom I may not know well: e.g., networking events at conferences.")), incl_fin$Q19.1, exclude = "")
chisq.test(setting_race2)
barplot(setting_race2, ylab="Underrepresented Racial Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,80), main="In which one of the following settings do you feel that you become \n aware of professional opportunities and contacts best?", args.legend = c(cex=.6))

#What types of opportunities are offered by your dept?
table(incl_fin$Q1)

#How many social activities per month--gender
attend<-table(incl_fin$Q5, incl_fin$Q18, exclude = "")
chisq.test(attend)
barplot(attend, ylab="Underrepresented Gender Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,50), main="What proportion of these social activities \n (with faculty and/or graduate students) \n would you say you attend each month?")

#Combine None and a Few and also about half and almost all
attend2<-table(fct_collapse(incl_fin$Q5,Low=c("None","A few"), High=c("About half","Almost all")), incl_fin$Q18, exclude = "")
chisq.test(attend2)
barplot(attend2, ylab="Underrepresented Gender Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,50), main="What proportion of these social activities \n (with faculty and/or graduate students) \n would you say you attend each month?")

#Subset by grad student and faculty member
attend3<-table(subset(incl_fin$Q5,incl_fin$Q20=="Grad Student"), subset(incl_fin$Q18,incl_fin$Q20=="Grad Student"), exclude = "")
chisq.test(attend3)
barplot(attend3, ylab="Underrepresented Gender Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,50), main="What proportion of these social activities \n (with faculty and/or graduate students) \n would you say you attend each month?")

attend4<-table(subset(incl_fin$Q5,incl_fin$Q20=="Faculty Member"), subset(incl_fin$Q18,incl_fin$Q20=="Faculty Member"), exclude = "")
chisq.test(attend4)
barplot(attend4, ylab="Underrepresented Gender Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,50), main="What proportion of these social activities \n (with faculty and/or graduate students) \n would you say you attend each month?")

#subsetted and combined
attend5<-table(fct_collapse(subset(incl_fin$Q5,incl_fin$Q20=="Grad Student"),Low=c("None","A few"), High=c("About half","Almost all")), subset(incl_fin$Q18,incl_fin$Q20=="Grad Student"), exclude = "")
chisq.test(attend5)
barplot(attend5, ylab="Underrepresented Gender Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,30), main="What proportion of these social activities \n (with faculty and/or graduate students) \n would you say you attend each month? \n (Grad Students only)")

attend6<-table(fct_collapse(subset(incl_fin$Q5,incl_fin$Q20=="Faculty Member"),Low=c("None","A few"), High=c("About half","Almost all")), subset(incl_fin$Q18,incl_fin$Q20=="Faculty Member"), exclude = "")
chisq.test(attend6)
barplot(attend6, ylab="Underrepresented Gender Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,30), main="What proportion of these social activities \n (with faculty and/or graduate students) \n would you say you attend each month? \n (Faculty only)")
#Close to signficance--female faculty seem to attend less, but not true for female grad student respondents

#How many social activities per month--race
attend_race<-table(incl_fin$Q5, incl_fin$Q19.1, exclude = "")
chisq.test(attend_race)
barplot(attend_race, ylab="Underrepresented Racial Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,80), main="What proportion of these social activities \n (with faculty and/or graduate students) \n would you say you attend each month?")

#How many social activities per month--intersection
attend_inter<-table(incl_fin$Q5, incl_fin$inter, exclude = "")
chisq.test(attend_inter)
barplot(attend_inter, ylab="Underrepresented Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,50), main="What proportion of these social activities \n (with faculty and/or graduate students) \n would you say you attend each month?")

#Combine None and a Few and also about half and almost all
attend2_race<-table(fct_collapse(incl_fin$Q5,Low=c("None","A few"), High=c("About half","Almost all")), incl_fin$Q19.1, exclude = "")
chisq.test(attend2_race)
barplot(attend2_race, ylab="Underrepresented Racial Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,80), main="What proportion of these social activities \n (with faculty and/or graduate students) \n would you say you attend each month?")

#included in dept's social activities--gender
included<-table(incl_fin$Q6, incl_fin$Q18, exclude = c("","Unsure"))
chisq.test(included)
barplot(included, ylab="Underrepresented Gender Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,50), main="Do you feel included in the department's social activities?")

#subsetted to grads and faculty
included2<-table(subset(incl_fin$Q6,incl_fin$Q20=="Grad Student"), subset(incl_fin$Q18,incl_fin$Q20=="Grad Student"), exclude = c("","Unsure"))
chisq.test(included2)
barplot(included2, ylab="Underrepresented Gender Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,50), main="Do you feel included in the department's social activities? \n (Grad Students Only)")

included3<-table(subset(incl_fin$Q6,incl_fin$Q20=="Faculty Member"), subset(incl_fin$Q18,incl_fin$Q20=="Faculty Member"), exclude = c("","Unsure"))
chisq.test(included3)
barplot(included3, ylab="Underrepresented Gender Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,50), main="Do you feel included in the department's social activities? \n (Faculty Only)")

#included in dept's social activities--race
included_race<-table(incl_fin$Q6, incl_fin$Q19.1, exclude = c("","Unsure"))
chisq.test(included_race)
barplot(included_race, ylab="Underrepresented Racial Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,80), main="Do you feel included in the department's social activities?")

#others included in dept's social activities--gender
included_others<-table(incl_fin$Q7, incl_fin$Q18, exclude = c("","Unsure"))
chisq.test(included_others)
barplot(included_others, ylab="Underrepresented Gender Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,50), main="Do you believe that all department members \n feel included in the department's activities?")

#Combine No and Sometimes vs Yes
included_others2<-table(fct_collapse(incl_fin$Q7,Low=c("No","Sometimes"), High=c("Yes")), incl_fin$Q18, exclude = c("","Unsure"))
chisq.test(included_others2)
barplot(included_others2, ylab="Underrepresented Gender Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,50), main="Do you believe that all department members \n feel included in the department's activities?")

#Combine No vs Sometimes and Yes
included_others3<-table(fct_collapse(incl_fin$Q7, Maybe=c("Sometimes","Yes")), incl_fin$Q18, exclude = c("","Unsure"))
chisq.test(included_others3)
barplot(included_others3, ylab="Underrepresented Gender Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,50), main="Do you believe that all department members \n feel included in the department's activities?")

included_others4<-table(subset(incl_fin$Q7,incl_fin$Q20=="Grad Student"), subset(incl_fin$Q18,incl_fin$Q20=="Grad Student"), exclude = c("","Unsure"))
chisq.test(included_others4)
barplot(included_others4, ylab="Underrepresented Gender Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,50), main="Do you believe that all department members \n feel included in the department's activities? \n (Grad Students Only)")

included_others5<-table(subset(incl_fin$Q7,incl_fin$Q20=="Faculty Member"), subset(incl_fin$Q18,incl_fin$Q20=="Faculty Member"), exclude = c("","Unsure"))
chisq.test(included_others5)
barplot(included_others5, ylab="Underrepresented Gender Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,50), main="Do you believe that all department members \n feel included in the department's activities? \n (Faculty Only)")

#others included in dept's social activities--race
included_others_race<-table(incl_fin$Q7, incl_fin$Q19.1, exclude = c("","Unsure"))
chisq.test(included_others_race)
barplot(included_others_race, ylab="Underrepresented Racial Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,80), main="Do you believe that all department members \n feel included in the department's activities?")

#those who recommend you--share gender
shared<-table(incl_fin$Q8, incl_fin$Q18, exclude = c("","Not Applicable"))
chisq.test(shared)
barplot(shared, ylab="Underrepresented Gender Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,50), main="Among colleagues who recommended that \n you apply for particular opportunities, \n did these individuals typically share your gender identity?")

#Combine lowest two and highest two
shared2<-table(fct_collapse(incl_fin$Q8, Rarely=c("Rarely or never shared my gender identity.","Sometimes shared my gender identity."), Usually=c("Almost always shared my gender identity.","Always shared my gender identity.")), incl_fin$Q18, exclude = c("","Not Applicable"))
chisq.test(shared2)
barplot(shared2, ylab="Underrepresented Gender Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,50), main="Recommended that you apply for particular opportunities.\n  Did these individuals typically share your gender identity?")

#subset by grads/faculty
shared3<-table(subset(incl_fin$Q8,incl_fin$Q20=="Grad Student"), subset(incl_fin$Q18,incl_fin$Q20=="Grad Student"), exclude = c("","Not Applicable"))
chisq.test(shared3)
barplot(shared3, ylab="Underrepresented Gender Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,50), main="Recommended that you apply for particular opportunities.\n  Did these individuals typically share your gender identity? \n (Grad Students Only)")

shared4<-table(subset(incl_fin$Q8,incl_fin$Q20=="Faculty Member"), subset(incl_fin$Q18,incl_fin$Q20=="Faculty Member"), exclude = c("","Not Applicable"))
chisq.test(shared4)
barplot(shared4, ylab="Underrepresented Gender Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,50), main="Recommended that you apply for particular opportunities.\n  Did these individuals typically share your gender identity? \n (Faculty Only)")

#those who recommend you--share race
shared_race<-table(incl_fin$Q9, incl_fin$Q19.1, exclude = c("","Not Applicable"))
chisq.test(shared_race)
barplot(shared_race, ylab="Underrepresented Racial Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,80), main="Among colleagues who recommended that \n you apply for particular opportunities, \n did these individuals typically share your racial identity?")

#those who recommend you--share gender: intersection
shared_inter<-table(incl_fin$Q8, incl_fin$inter, exclude = c("","Not Applicable"))
chisq.test(shared_inter)
barplot(shared_inter, ylab="Underrepresented Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,50), main="Among colleagues who recommended that \n you apply for particular opportunities, \n did these individuals typically share your gender identity?")

#those who recommend you--share gender: intersection combined
shared_inter2<-table(fct_collapse(incl_fin$Q8, Rarely=c("Rarely or never shared my gender identity.","Sometimes shared my gender identity."), Usually=c("Almost always shared my gender identity.","Always shared my gender identity.")), incl_fin$inter, exclude = c("","Not Applicable"))
chisq.test(shared_inter2)
barplot(shared_inter2, ylab="Underrepresented Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,50), main="Among colleagues who recommended that \n you apply for particular opportunities, \n did these individuals typically share your gender identity?")

#those who recommend you--share race: intersection
shared_inter_race<-table(incl_fin$Q9, incl_fin$inter, exclude = c("","Not Applicable"))
chisq.test(shared_inter_race)
barplot(shared_inter_race, ylab="Underrepresented Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,80), main="Among colleagues who recommended that \n you apply for particular opportunities, \n did these individuals typically share your racial identity?")

#Combine lowest two and highest two
shared2_race<-table(fct_collapse(incl_fin$Q9, Rarely=c("Rarely or never shared my racial identity.","Sometimes shared my racial identity."), Usually=c("Almost always shared my racial identity.","Always shared my racial identity.")), incl_fin$Q19.1, exclude = c("","Not Applicable"))
chisq.test(shared2_race)
barplot(shared2_race, ylab="Underrepresented Racial Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,80), main="Recommended that you apply for particular opportunities.\n  Did these individuals typically share your racial identity?")

#those who recommend you--share race: intersection combined
shared_inter_race2<-table(fct_collapse(incl_fin$Q9, Rarely=c("Rarely or never shared my racial identity.","Sometimes shared my racial identity."), Usually=c("Almost always shared my racial identity.","Always shared my racial identity.")), incl_fin$inter, exclude = c("","Not Applicable"))
chisq.test(shared_inter_race2)
barplot(shared_inter_race2, ylab="Underrepresented Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,80), main="Among colleagues who recommended that \n you apply for particular opportunities, \n did these individuals typically share your racial identity?")

#opportunity to consider candidates?--gender
opp_consider<-table(incl_fin$Q12, incl_fin$Q18)
chisq.test(opp_consider)
barplot(opp_consider, ylab="Underrepresented Gender Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,50), main="Have you ever had an opportunity to consider \n and select candidates for a professional opportunity?")

#opportunity to consider candidates?--race
opp_consider_race<-table(incl_fin$Q12, incl_fin$Q19.1)
chisq.test(opp_consider_race)
barplot(opp_consider_race, ylab="Underrepresented Racial Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,80), main="Have you ever had an opportunity to consider \n and select candidates for a professional opportunity?")
#Significant difference

#did cands recommended to you share your gender id?
rec_share<-table(incl_fin$Q13, incl_fin$Q18, exclude = c("","No one was ever recommended to me."))
chisq.test(rec_share)
barplot(rec_share, ylab="Underrepresented Gender Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,30), main=" Did the candidates that were recommended \n share your gender identity?")

#Keeping no one category
rec_share3<-table(incl_fin$Q13, incl_fin$Q18, exclude = c(""))
chisq.test(rec_share3)
barplot(rec_share3, ylab="Underrepresented Gender Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,30), main=" Did the candidates that were recommended \n share your gender identity?")

#Combine lowest two with highest two
rec_share2<-table(fct_collapse(incl_fin$Q13, Rarely=c("Rarely or never shared my gender identity.","Sometimes shared my gender identity."), Usually=c("Almost always shared my gender identity.","Always shared my gender identity.")), incl_fin$Q18, exclude = c("","No one was ever recommended to me."))
chisq.test(rec_share2)
barplot(rec_share2, ylab="Underrepresented Gender Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,30), main=" Did the candidates that were recommended \n share your gender identity?")

#did cands recommended to you share your racial id?
rec_share_race<-table(incl_fin$Q14, incl_fin$Q19.1, exclude = c("","No one was ever recommended to me."))
chisq.test(rec_share_race)
barplot(rec_share_race, ylab="Underrepresented Racial Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,50), main=" Did the candidates that were recommended \n share your racial identity?")

#did cands recommended to you share your gender id: intersection?
rec_share_inter<-table(incl_fin$Q13, incl_fin$inter, exclude = c("","No one was ever recommended to me."))
chisq.test(rec_share_inter)
barplot(rec_share_inter, ylab="Underrepresented Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,30), main=" Did the candidates that were recommended \n share your gender identity?")

#did cands recommended to you share your racial id: intersection?
rec_share_inter_race<-table(incl_fin$Q14, incl_fin$inter, exclude = c("","No one was ever recommended to me."))
chisq.test(rec_share_inter_race)
barplot(rec_share_inter_race, ylab="Underrepresented Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,50), main=" Did the candidates that were recommended \n share your racial identity?")

#how likely to apply w/o approached--gender
approach<-table(incl_fin$Q11, incl_fin$Q18)
chisq.test(approach)
barplot(approach, ylab="Underrepresented Gender Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,50), main="How likely are you to apply for an \n opportunity for which you were not approached, \n recommended, or recruited?")

#how likely to apply w/o approached--race
approach_race<-table(incl_fin$Q11, incl_fin$Q19.1)
chisq.test(approach_race)
barplot(approach_race, ylab="Underrepresented Racial Identity?", xlab="Number of Respondents", legend.text=TRUE, horiz=TRUE, xlim=c(0,80), main="How likely are you to apply for an \n opportunity for which you were not approached, \n recommended, or recruited?")